//预处理阶段编程
#include "fwd.hpp"  //双引号 先是当前路径 再去系统路径
#include <iostream> //角括号 只在系统路径

#if __has_include(<optional>) //用来检查是否有optional 有则include
#include <optional>
#endif

using namespace std;

int main()
{
#if __cplusplus >= 202002
    cout << "C++20 or later" << endl;
#elif __cplusplus >= 201703
    cout << "C++20 or later" << endl;
    cout << __FILE__ << endl;
    cout << __LINE__ << endl;
    cout << __DATE__ << endl;
    cout << "C++20 or later" << endl;
#else
# error "C++ is old!!!"
#endif

#if defined(__cpp_decltype_auto)
    cout << "__cpp_decltype_auto enable" << endl;
#endif

#if defined(__cpp_decltype)
    cout << "__cpp_decltype enable" << endl;
#endif

#if defined(__cpp_modules)
    cout << "__cpp_modules enable" << endl;
#endif

#if defined(__cpp_lib_make_unique)
    cout << "__cpp_lib_make_unique enable" << endl;
#endif

#if __GNUC__ <= 6
    cout << "GCC version is old" << endl;
#else
    cout << "GCC version is " << __GNUC__ << endl;
    cout << "GCC minor is " << __GNUC_MINOR__  << endl;
    cout << "GCC patch level is " << __GNUC_PATCHLEVEL__  << endl;
    cout << "GCC Version is "  << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << endl;
#endif

#if 0  //条件编译常用技巧 禁用代码
    cout << "I am commented by #if" << endl;
#endif
}